<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script type="text/javascript">
	
	/**
	 * 查看销售单详情
	 * @param soid
	 */
	function showDetail(soid, tr) {
		var nextTr = $(tr).next("tr");
		if (nextTr.css("display") == "none") {
			nextTr.find("td").load("main/somain/somainDetail", {"soid" : soid }, function() {

			});
		}
		nextTr.toggle();
	}
</script>


<table width="100%" border="0" align="center" cellspacing="1" class="c">
	<tr>
		<td class="title1">销售单编号</td>
		<td class="title1">创建时间</td>
		<td class="title1">客户名称</td>
		<td class="title1">创建用户</td>
		<td class="title1">附加费用</td>
		<td class="title1">产品总价</td>
		<td class="title1">销售单总价格</td>
		<td class="title1">付款方式</td>
		<td class="title1">最低预付款金额</td>
		<td class="title1">处理状态</td>
		<td class="title1">操作</td>
	</tr>
	<c:forEach items="${page.dataList }" var="so">
		<tr ondblclick="showDetail(${so.soId},this)" title="双击查看详情">
			<td align="center">${so.soId }</td>
			<td align="center">${so.createTime }</td>
			<td align="center">${so.customerName}</td>
			<td align="center">${so.account}</td>
			<td align="center">${so.tipFee}</td>
			<td align="center">${so.poTotal}</td>
			<td align="center">${so.productTotal}</td>
			<td align="center">${so.payType}</td>
			<td align="center">${so.prePayFee}</td>
			<td align="center">
				<c:if test="${so.status ==1 }">新增</c:if> 
				<c:if test="${so.status ==2 }">已付款</c:if> 
				<c:if test="${so.status ==3 }">已预付</c:if>
				<c:if test="${so.status ==4 }">已入库</c:if> 
				<c:if test="${so.status ==5 }">已了结</c:if></td>
			<td align="center">
			<a href="javascript:payment(${so.soId},<c:if test="${so.payType == '货到付款' || so.payType=='款到发货' || (so.payType == '预付款到发货' && so.status ==3)}">1</c:if>
			<c:if test="${so.payType == '预付款到发货' && so.status ==1}">2</c:if>)">
				<c:if test="${so.payType == '货到付款' || so.payType=='款到发货'}">收款登记</c:if>
				<c:if test="${so.payType == '预付款到发货' && so.status ==1}">预收款登记</c:if>
				<c:if test="${so.payType == '预付款到发货' && so.status ==3}">尾款登记</c:if>
			</a></td>
		</tr>
		<tr style="display:none">
			<td colspan="11" name="detail"></td>
		</tr>
	</c:forEach>
</table>
<!-- 导入分页层 -->
<%@include file="../../public/page.jsp"%>